<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%>
<%@page import="com.feib.soeasy.util.UserUtil"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><%=UserUtil.getCurrentMenuItemName() %></title>    
    <script type="text/javascript" src="<c:url value='/scripts/jquery/jquery.bgiframe-2.1.2.js'/>"></script>    
    <script type="text/javascript">
    <!-- 
    $(document).ready(function() {
    	$('#doSaveBtn').click(function() {
            var userName = $('#userName').val();
            var userEmail = $('#userEmail').val();
            
            var errMsg = "";
            
            if (null == userName || '' == userName){
                errMsg = errMsg + "姓名 是必要欄位<br/>";
            }
            
            if (null == userEmail || '' == userEmail){
                errMsg = errMsg + "Email 是必要欄位<br/>";
            }
			else if (! verifyEmail(userEmail)){
				errMsg = errMsg + "E-MAIL 格式錯誤<br/>";
			}
            
            if (0 != errMsg.length){
                $("#ajaxErrorMessageDiv").html(errMsg);
                $("#ajaxErrorMessageDiv" ).dialog({  
                    title:'請修正下列錯誤' 
                    ,width: 300
                    , resizable: false
                    , modal: true
                    , buttons: {
                        Ok: function() {
                            $( this ).dialog( "close" );
                        }
                    }
                });
                return false;
            }
        });
    });
    //-->
    </script>
</head>
<body>
<div id="mainAreaCT">
        <jsp:include page="/includes/path.jsp"/>
        <jsp:include page="/includes/subMenu.jsp"/>
        
    <div id="roleFormDiv">
        <stripes:form id="roleFrom" beanclass="com.feib.soeasy.action.Soez9010ActionBean" method="post"
            onsubmit="javascript: waitingDialog({});">
               
            <table id="queryForm">
                <tr>
                    <th>姓名<span id="mustKeyInStar">**</span></th>
                    <td>
                        <stripes:text id="userName" name="user.userName" size="20" maxlength="20" />
                    </td>
                </tr>
                <tr>
                    <th>電話</th>
                    <td>
                        <stripes:text id="userPhone" name="user.userPhone" size="20" maxlength="20" />
                    </td>
                </tr> 
                <tr>
                    <th>Email<span id="mustKeyInStar">**</span></th>
                    <td>
                        <stripes:text id="userEmail" name="user.userEmail" size="40" maxlength="50" />
                    </td>
                </tr>                                 
                <tr>
                    <th>備註</th>
                    <td>
                        <stripes:text id="userMemo" name="user.userMemo" size="50" maxlength="100" />
                    </td>
                </tr>                                
                <tr>
                    <td colspan="2" class="queryFunction">
                        <stripes:hidden id="userPk" name="user.userPk" />
                        <stripes:submit id="doSaveBtn" name="doSave" value="確認" class="formBtn"/>
                    </td>
                </tr>
            </table>
        </stripes:form>
    </div>  
    <!-- Message -->
    <div id="ajaxErrorMessageDiv" style="display: none;">
    </div>    
    <c:if test="${null != actionBean.message }">
	    <script type="text/javascript">
	    <!--
	        $("#ajaxErrorMessageDiv").html('${actionBean.message }');
	        $("#ajaxErrorMessageDiv" ).dialog( "destroy" );
	        $("#ajaxErrorMessageDiv" ).dialog({  
	            title:'${actionBean.messageTitle }' 
	            , width: 400, height : 150
	            , resizable: false
	            , modal: true
	            , buttons: {
	                Ok: function() {
	                    $( this ).dialog( "close" );
	                }
	            }
	        });
	    //-->
	    </script>
    </c:if>            
</div>    
</body>
</html>                       